package com.wzg.mytableview.smart;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.bin.david.form.core.SmartTable;
import com.wzg.mytableview.R;

import java.util.ArrayList;

/**
 * author：wzg
 * date:
 * desc:注解模式
 */
public class CommentActivity extends AppCompatActivity {


    private SmartTable<Material> table;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_comment);

        table = findViewById(R.id.smartTable);


        ArrayList<Material> materials = new ArrayList<>();

        for (int i = 0; i < 10; i++) {
            if (i==6){
                materials.add(new Material("asdfghjkl123343243243" , "1000.00000" , "500.000000" ));
            }else {
                materials.add(new Material("物料no" + i, "入库数量" + i, "实际入库数" + i));
            }

        }


        table.getConfig().setShowTableTitle(false);
        table.getConfig().setShowColumnTitle(true);
        table.getConfig().setShowXSequence(false);
        table.getConfig().setShowYSequence(false);
//        table.getConfig().setCountStyle(new FontStyle())
//        table.getConfig().setFixedCountRow(false);
//        table.getConfig().showC
//        table.setSortColumn();
        table.setData(materials);
    }
}